#ifndef PBVP_MACT_TOOLS_H
#define PBVP_MACT_TOOLS_H

#include <QAction>
#include "../toolplugin.h"
#include "../../datamanager/fileextensionmanager.h"

namespace PBVP {
	class DCTreeControl;
	class MatchControl;
	class DualGraph;
	/// 
	class MactToolsPlugin : public QObject, public ToolPlugin
	{
		Q_OBJECT
		Q_INTERFACES(PBVP::ToolPlugin)
	public:
		/// Default Constructor
		MactToolsPlugin();

		/// Default Destructor
		virtual ~MactToolsPlugin();

		///
		virtual QString description() const {
			return QString("Compute Dual Contour Tree and Node Attributes");
		} 

		/// 
		virtual void initialize(MainInterface* mainInterface);

		///
		virtual bool isSupported(DataNode* pNode);

		///
		virtual QMenu* getToolMenu() {
			return mactMenu;
		}

	public slots:
		/// 
		void constructDCTree();

		/// 
		void mactMatch();

	private:
		QMenu *mactMenu;

		QAction *dctAction;
		QAction *mactMatchAction;

		DataManager *m_pDataManager;

		RenderManager *m_pRenderManager;

		DCTreeControl *m_pDCTControl;
		MatchControl *m_pMatchControl;

		FileExtensionManager *m_pFileExtManager;

		/**
		 * 
		 * @param volFileName
		 * @param dctFileName
		 * 
		 * @return DualGraph* Return NULL if failed to construct a DC 
		 *         Tree
		 */
		DualGraph* getDCTree(const QString& volFileName, const QString& dctFileName);
	};
}
#endif